package com.caicai.springbootrocketmq.consumer;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;

/**
 * @author chenrui
 * @date 2024/12/9
 */
@Configuration
public class ConsumerConfig {
    @Value("${rocketmq.name-server}")
    private String nameServer;

    @Bean
    public ConsumerListenerAnnotationHandler getConsumerListenerAnnotationHandler(ApplicationContext applicationContext, ThreadPoolTaskExecutor executor){
        return new ConsumerListenerAnnotationHandler(applicationContext, executor, nameServer);
    }
}
